//数组的解构
const arr = [1, 2, 3];

const [a1, a2, a3] = arr;//字面量解构
console.log(a1, a2, a3);

const [, , b3] = arr;//指定位置解构
console.log(b3)

const [c1, ...rest] = arr;//解构某个位置后所有数据
console.log(rest);

const [d1, d2, d3, d4] = arr;
console.log(d4);//undefined

const [e1, e2, e3 = 123, e4 = 'abc'] = arr;//添加默认值
console.log(e3, e4);
